#ifndef SKYPEPLUGIN_H
#define SKYPEPLUGIN_H

#include <QtPlugin>
#include <QList>
#include <QDebug>
#include <QAxObject>
#include <QAxBase>
#include <QTimer>
#include "plugininterface.h"

#import "Skype4COM.dll"
using namespace SKYPE4COMLib;

#define VERSION "0.1"

class SkypePlugin: public QObject, PluginInterface
{
    Q_OBJECT
    Q_INTERFACES(PluginInterface)

public:
    SkypePlugin();
    ~SkypePlugin();
    QString name();
    QList<Setting> settings();
    void updateSetting(QString name, QVariant value);
    QString version();
    void setEnabled(bool enabled);

private:
    QList<Setting> m_settings;
    QAxObject* m_skypeController;
    BlinkSequence m_missedMessageBlinkSequence;
    BlinkSequence m_incommingCallBlinkSequence;
    QTimer* m_missedMessageTimer;
    bool m_enabled;

    void constructBlinkSequence();

private slots:
    void Sink(const QString& name, int argc, void * argv);
    void checkMissedMessages();

signals:
    void blinkReady(BlinkSequence blinkSequence);
};

#endif // SKYPEPLUGIN_H
